<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?>
  <div class="user-body">
  	<div class="body-content">
      <div class="body-title">
       	<?php echo lang('trade_record');?>      </div>
      
      <div class="list">
      	
<?php
if (count($coins) <= 11) {
?>      	<div class="coins">
	      	
<?php
	foreach ($coins as $v) {
?>	      	<a 
<?php
		if ($coin['id'] == $v['id']) {
?>class="on"<?php
		}

?> href="javascript:void(0);" class="coin-tab" data-id="<?php echo $v['id'];?>"><?php echo $v['en_name'];?></a>
	      	<?php
	}

?>	      	<div class="clear"></div>
	    </div>
	    <script type="text/javascript">
		$(function(){
			$('.coin-tab').click(function(){
				$.cookie('coin_id',$(this).attr('data-id'));
				location.reload();
			});
		});
	    </script>
	    <?php
}
else {
?>	    <div class="coins">
	      	<a class="on">
	      		<select id="coin_id" style="border:0px;">
			        
<?php
	foreach ($coins as $v) {
?>			        <option value="<?php echo $v['id'];?>" 
<?php
		if ($coin['id'] == $v['id']) {
?>selected<?php
		}

?>><?php echo $v['en_name'];?></option>
			        <?php
	}

?>		        </select>
	      	</a>
	      	<div class="clear"></div>
	    </div>
	    <script type="text/javascript">
		$(function(){
			$('#coin_id').change(function(){
				$.cookie('coin_id',$(this).val());
				location.reload();
			});
		});
	    </script>
	    <?php
}

?>        <table cellspacing=0 cellpadding=0 border=0>
				<thead>
					<tr>
						<th width=150><?php echo lang('trade_time');?></th>
						<th><?php echo lang('trade_type');?></th>
						<th><?php echo lang('trade_price');?></th>
						<th><?php echo lang('trade_num');?></th>
						<th><?php echo lang('trade_total');?></th>
					</tr>
				</thead>
				<tbody>
				
<?php
foreach ($list as $v) {
?>					<tr>
						<td><?php echo date('Y-m-d H:i:s', $v['add_time']);?></td>
						<td><?php echo $v['type'];?></td>
						<td><?php echo $v['price'];?></td>
						<td><?php echo $v['num'];?></td>
						<td><?php echo $v['total'];?></td>
					</tr>
				<?php
}

?>				</tbody>
			</table>
			<div class="page">
			  <?php echo $page;?>			</div>
			
<?php
if (!$list) {
?>			<div class="not-list">
				<i class="fa fa-ban"></i>
				<span><?php echo lang('user_not_list');?></span>
			</div>
			<?php
}

?>      </div>
      
    </div>
  </div>
  <div class="clear"></div>
</div>
<script>
$(function(){
	$('.coin-tab').click(function(){
		$.cookie('coin_id',$(this).attr('data-id'));
		location.reload();
	});
	$('#coin_id').change(function(){
		$.cookie('coin_id',$(this).val());
		location.reload();
	});
});
</script>